package com.itheima.myreflect2.Student.demo;

import java.util.concurrent.CountDownLatch;

/**
 * @program: Myset
 * @description:
 * @author: xuejingjing
 * @create: 2021-06-20 15:42
 **/
public class ChildThread3 extends Thread{
    private CountDownLatch countDownLatch;
    public ChildThread3(CountDownLatch countDownLatch) {
        this.countDownLatch = countDownLatch;
    }

    @Override

    public void run() {
        //1，吃饺子
        for (int i = 0; i < 20; i++) {
            System.out.println(getName()+"在吃第"+i+"个饺子");
        }
        //吃完说一声
        countDownLatch.countDown();
    }
}
